package com.kermel.andromeda.common.action;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View.OnClickListener;

// TODO: No need to do so right now, but at some point might want to create a ContextAction and put all the context-related stuff into it.
public abstract class ViewClickAction implements OnClickListener {
    protected Context context;

    public ViewClickAction(Context context) {
        this.context = context;
    }
    
    protected void launchActivity(Class<? extends Activity> activityClass) {
        launchActivity(context, activityClass);
    }
    
    protected static void launchActivity(Context callerContext, Class<? extends Activity> activityClass) {
        if (callerContext != null && activityClass != null) {
            Intent intent = new Intent(callerContext, activityClass);
            callerContext.startActivity(intent);
        }
    }
}
